#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Volume.h>
#include <Length.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(VolumeUnit)
{     
   TEST(1 TBSP should be equal to 3 TSP)
   {
      Volume volumeInTbsp(1, TBSP);
      Volume volumeInTsp(3, TSP);
      
      ASSERT_TRUE(volumeInTbsp == volumeInTsp);
   }

   TEST(1 OZ should be equal to 2 TBSP)
    {
      Volume volumeInOz(1, OZ);
      Volume volumeInTbsp(2, TBSP);
      
      ASSERT_TRUE(volumeInOz == volumeInTbsp);
    }

   TEST(1 OZ should be equal to 6 TSP)
    {
      Volume volumeInOz(1, OZ);
      Volume volumeInTsp(6, TSP);
      
      ASSERT_TRUE(volumeInOz == volumeInTsp);
    }

   TEST(2 OZ should be equal to 2 TBSP + 6 TSP)
    {
      Volume volumeInOz(2, OZ);
      Volume volumeInTbsp(2, TBSP);
      Volume volumeInTsp(6, TSP);

      ASSERT_TRUE(volumeInOz == (volumeInTbsp + volumeInTsp));
    }

   TEST(3 TBSP should be equal to 1 OZ + 3 TSP)
    {
      Volume volumeInOz(1, OZ);
      Volume volumeInTbsp(3, TBSP);
      Volume volumeInTsp(3, TSP);
      
      ASSERT_TRUE(volumeInTbsp == (volumeInOz + volumeInTsp));
    }

    TEST(print 25 TBSP should be 12 OZ 1 TBSP)
    {
      std::stringstream os;
      os << Volume(25, TBSP, OZ);;     

      ASSERT_TRUE(std::string("12 OZ 1 TBSP") == os.str());
    }

    TEST(print 76 TSP should be 12 OZ 1 TBSP 1 TSP)
    {
      std::stringstream os;
      os << Volume(76, TSP, OZ);;  
   
      ASSERT_TRUE(std::string("12 OZ 1 TBSP 1 TSP") == os.str());
    }

    TEST(print 25 TBSP should be 75 TSP)
    {
      std::stringstream os;
      os << Volume(25, TBSP, TSP);;     

      ASSERT_TRUE(std::string("75 TSP") == os.str());
    }

    TEST(print 12 OZ should be 72 TSP)
    {
      std::stringstream os;
      os << Volume(12, OZ, TSP);
   
      ASSERT_TRUE(std::string("72 TSP") == os.str());
    }
};

